﻿Imports TransportadoraToledoDAL
Public Class ContasAPagarBLL
    Dim objDAL As ContasAPagarDAL

#Region "PROPRIEDADES"
    Private aba_codigo As Integer
    Public Property pAba_codigo() As Integer
        Get
            Return aba_codigo
        End Get
        Set(ByVal value As Integer)
            aba_codigo = value
        End Set
    End Property

    Private descricao As String
    Public Property pDescricao() As String
        Get
            Return descricao
        End Get
        Set(ByVal value As String)
            descricao = value
        End Set
    End Property
#End Region


#Region "METODOS"
    Function localizarAbastecimento(ByVal dataInicio As Date, ByVal dataFinal As Date) As DataTable
        objDAL = New ContasAPagarDAL
        Dim tab As New DataTable
        Try
            tab = objDAL.localizarAbastecimento(dataInicio, dataFinal)
        Catch ex As Exception
            Throw ex
        End Try
        objDAL = Nothing
        Return tab
    End Function

    Function localizaOrdemDeServicos(inicio As Date, fim As Date) As DataTable
        objDAL = New ContasAPagarDAL
        Dim tab As New DataTable
        Try
            tab = objDAL.localizarOrdemServico(inicio, fim)
        Catch ex As Exception
            Throw ex
        End Try
        objDAL = Nothing
        Return tab
    End Function

    Sub inserirAbastecimento(ByVal codigo As Integer, ByVal descricao As String, forma As String, datapgto As Date)
        objDAL = New ContasAPagarDAL
        Try
            objDAL.inserirAbastecimento(codigo, descricao, forma, datapgto)
        Catch ex As Exception
            Throw ex
        End Try
        objDAL = Nothing
    End Sub

    Sub inserirOrdem(ByVal codigo As Integer, ByVal descricao As String, forma As String, datapgto As Date)
        objDAL = New ContasAPagarDAL
        Try
            objDAL.inserirOrdem(codigo, descricao, forma, datapgto)
        Catch ex As Exception
            Throw ex
        End Try
        objDAL = Nothing
    End Sub

    Function localizarAbastecimentoBaixados(inicio As Date, fim As Date) As DataTable
        objDAL = New ContasAPagarDAL
        Dim tab As New DataTable
        Try
            tab = objDAL.localizarAbastecimentoBaixados(inicio, fim)
        Catch ex As Exception
            Throw ex
        End Try
        objDAL = Nothing
        Return tab
    End Function

    Function localizaOrdemDeServicosBaixados(inicio As Date, fim As Date) As DataTable
        objDAL = New ContasAPagarDAL
        Dim tab As New DataTable
        Try
            tab = objDAL.localizarOrdemServicoBaixados(inicio, fim)
        Catch ex As Exception
            Throw ex
        End Try
        objDAL = Nothing
        Return tab
    End Function

    Function localizaGeral(inicio As Date, fim As Date) As DataTable
        objDAL = New ContasAPagarDAL
        Dim tab As New DataTable
        Try
            tab = objDAL.LocalizaGeral(inicio, fim)
        Catch ex As Exception
            Throw ex
        End Try
        objDAL = Nothing
        Return tab
    End Function

    Function localiza() As DataTable
        objDAL = New ContasAPagarDAL
        Dim tab As New DataTable
        Try
            tab = objDAL.Localiza()
        Catch ex As Exception
            Throw ex
        End Try
        objDAL = Nothing
        Return tab
    End Function

#End Region
End Class
